package com.mgface.springdata.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

/**
 * @author wanyuxiang
 * @version 1.0
 * @project springdataCollection
 * @create 2018-08-18 22:55
 **/
@Document(indexName = "book",type = "article") //indexName 索引名称，type 类型名称
@Data
public class Article {

    @Id
    private Long id;
    //index 是否开启分词器
    //store 是否开启顺序
    //analyzer 指定分词器
    //searchAnalyzer 指定搜索时的分词器
    @Field//(type = FieldType.Nested,index = FieldIndex.analyzed,store = true,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String content;

}
